﻿@{
    ViewData["Title"] = "操作日志";
}

<div class="content-top-nav">
    <div class="layui-row">
        <div class="layui-col-md11">
            <h3 style="color:#444">
                <i class="layui-icon layui-icon-home"></i>
                @ViewData["Title"]
            </h3>
        </div>
        <div class="layui-col-md1" style="text-align:right;">
        </div>
    </div>
    <hr>
</div>

<div class="layui-fluid" style="margin-bottom:50px;">
    <script type="text/html" id="toolbarAE">
        <div><i class="layui-icon layui-icon-log"></i> 数据库操作日志只保留总量最新的5000条</div>
    </script>

    <table class="layui-hide" id="currentTableId" lay-data="{id: 'idReload'}" lay-filter="currentTableFilter"></table>

    <script type="text/html" id="NameTpl">
        {{d.username}} ({{d.nickname}})
    </script>
</div>

<script>
    layui.use(['table', 'jquery', 'form'], function () {
        var table = layui.table, $ = layui.jquery, form = layui.form;
        table.render({
            elem: '#currentTableId',
            url: '/Admin/Log/Index?json=1',
            toolbar: '#toolbarAE',
            cols: [[
                { field: 'id', title: 'Id' },
                { field: 'username', title: '操作用户' , templet: '#NameTpl'},
                { field: 'controllerAction', title: '操作方法' },
                { field: 'ip', title: 'Ip', sort: true },
                { field: 'time', title: '时间', sort: true },
                { field: 'doThing', title: '记录' },
            ]],
            limits: [10, 15, 20, 25, 50, 100],
            limit: 20,
            id: 'tableReload',
            page: true
        });
    });
</script>
